package college

import (
	. "apiserver/handler"
	"apiserver/model"
	"github.com/gin-gonic/gin"
)

type ParamResponse struct {
	Total []*model.College `json:"total"`
	Count int              `json:"count"`
}

func GetCollegeList(c *gin.Context) {
	colleges, count, err := model.GetCollegeList(1, 20)
	if err != nil {
		SendResponse(c, err, nil)
	}
	SendResponse(c, nil, ParamResponse{
		Total: colleges,
		Count: count,
	})
}
